home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / buttnbar / frmtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-01-14  |  32.1 KB  |  878 lines

  1. VERSION 5.00
  2. Object = "{14F9E740-9837-11D1-AD8F-EA2E8FD0173F}#7.1#0"; "ButtnBar.ocx"
  3. Begin VB.Form frmTest 
  4.    Caption         =   "DevPower Button Bar Example"
  5.    ClientHeight    =   7530
  6.    ClientLeft      =   4200
  7.    ClientTop       =   2595
  8.    ClientWidth     =   8715
  9.    Icon            =   "frmTest.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   502
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   581
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.PictureBox SizeBar 
  17.       BackColor       =   &H008080FF&
  18.       BorderStyle     =   0  'None
  19.       Height          =   6075
  20.       Left            =   1785
  21.       MouseIcon       =   "frmTest.frx":0442
  22.       MousePointer    =   99  'Custom
  23.       ScaleHeight     =   405
  24.       ScaleMode       =   3  'Pixel
  25.       ScaleWidth      =   6
  26.       TabIndex        =   3
  27.       TabStop         =   0   'False
  28.       Top             =   120
  29.       Width           =   90
  30.       Begin VB.Line lnLightShadow 
  31.          BorderColor     =   &H80000014&
  32.          X1              =   5
  33.          X2              =   5
  34.          Y1              =   333
  35.          Y2              =   286
  36.       End
  37.       Begin VB.Line lnShadow 
  38.          BorderColor     =   &H80000010&
  39.          X1              =   4
  40.          X2              =   4
  41.          Y1              =   182
  42.          Y2              =   286
  43.       End
  44.    End
  45.    Begin VB.PictureBox picMain 
  46.       BorderStyle     =   0  'None
  47.       Height          =   5805
  48.       Left            =   1950
  49.       ScaleHeight     =   5805
  50.       ScaleWidth      =   5700
  51.       TabIndex        =   1
  52.       Top             =   525
  53.       Width           =   5700
  54.       Begin VB.CommandButton cmdNavHistory 
  55.          Caption         =   "History"
  56.          Enabled         =   0   'False
  57.          Height          =   645
  58.          Left            =   2505
  59.          MaskColor       =   &H00FF00FF&
  60.          Picture         =   "frmTest.frx":0594
  61.          Style           =   1  'Graphical
  62.          TabIndex        =   30
  63.          ToolTipText     =   "New in 1.0.4 - Navigation History"
  64.          Top             =   3705
  65.          UseMaskColor    =   -1  'True
  66.          Width           =   1110
  67.       End
  68.       Begin VB.CommandButton cmdNavForward 
  69.          Caption         =   "Foward"
  70.          Enabled         =   0   'False
  71.          Height          =   645
  72.          Left            =   1380
  73.          Picture         =   "frmTest.frx":0696
  74.          Style           =   1  'Graphical
  75.          TabIndex        =   28
  76.          ToolTipText     =   "New in 1.0.4 - Navigation History"
  77.          Top             =   3705
  78.          UseMaskColor    =   -1  'True
  79.          Width           =   1110
  80.       End
  81.       Begin VB.CommandButton cmdNavBack 
  82.          Caption         =   "Back"
  83.          Enabled         =   0   'False
  84.          Height          =   645
  85.          Left            =   240
  86.          Picture         =   "frmTest.frx":0798
  87.          Style           =   1  'Graphical
  88.          TabIndex        =   27
  89.          ToolTipText     =   "New in 1.0.4 - Navigation History"
  90.          Top             =   3705
  91.          UseMaskColor    =   -1  'True
  92.          Width           =   1110
  93.       End
  94.       Begin VB.CommandButton cmdAddItem 
  95.          Caption         =   "Add Item"
  96.          Height          =   645
  97.          Left            =   240
  98.          Picture         =   "frmTest.frx":089A
  99.          Style           =   1  'Graphical
  100.          TabIndex        =   26
  101.          Top             =   2145
  102.          UseMaskColor    =   -1  'True
  103.          Width           =   1110
  104.       End
  105.       Begin VB.CommandButton cmdRelabelItem 
  106.          Caption         =   "Rename Item"
  107.          Height          =   645
  108.          Left            =   1380
  109.          Picture         =   "frmTest.frx":0994
  110.          Style           =   1  'Graphical
  111.          TabIndex        =   25
  112.          Top             =   2145
  113.          UseMaskColor    =   -1  'True
  114.          Width           =   1110
  115.       End
  116.       Begin VB.CommandButton cmdRemoveCurrItem 
  117.          Caption         =   "Remove Current"
  118.          Height          =   645
  119.          Left            =   2505
  120.          Picture         =   "frmTest.frx":0A8E
  121.          Style           =   1  'Graphical
  122.          TabIndex        =   24
  123.          Top             =   2145
  124.          UseMaskColor    =   -1  'True
  125.          Width           =   1305
  126.       End
  127.       Begin VB.CommandButton cmdRemoveLastItem 
  128.          Caption         =   "Remove Last"
  129.          Height          =   645
  130.          Left            =   3840
  131.          Picture         =   "frmTest.frx":0E6A
  132.          Style           =   1  'Graphical
  133.          TabIndex        =   23
  134.          Top             =   2145
  135.          UseMaskColor    =   -1  'True
  136.          Width           =   1110
  137.       End
  138.       Begin VB.CommandButton cmdInsertItem 
  139.          Caption         =   "Insert after Current"
  140.          Height          =   510
  141.          Left            =   240
  142.          TabIndex        =   22
  143.          Top             =   2805
  144.          Width           =   1110
  145.       End
  146.       Begin VB.CommandButton cmdAddTab 
  147.          Caption         =   "Add Tab"
  148.          Height          =   645
  149.          Left            =   240
  150.          Picture         =   "frmTest.frx":1246
  151.          Style           =   1  'Graphical
  152.          TabIndex        =   21
  153.          Top             =   1215
  154.          UseMaskColor    =   -1  'True
  155.          Width           =   1110
  156.       End
  157.       Begin VB.CheckBox chkEnabled 
  158.          Caption         =   "Current Item Enabled"
  159.          Height          =   435
  160.          Left            =   1380
  161.          TabIndex        =   20
  162.          Top             =   2835
  163.          Width           =   1815
  164.       End
  165.       Begin VB.CommandButton cmdRemoveTab 
  166.          Caption         =   "Remove Last"
  167.          Height          =   645
  168.          Left            =   3840
  169.          Picture         =   "frmTest.frx":1340
  170.          Style           =   1  'Graphical
  171.          TabIndex        =   18
  172.          Top             =   1215
  173.          UseMaskColor    =   -1  'True
  174.          Width           =   1110
  175.       End
  176.       Begin VB.CommandButton cmdRemoveCurrTab 
  177.          Caption         =   "Remove Current"
  178.          Height          =   645
  179.          Left            =   2505
  180.          Picture         =   "frmTest.frx":171C
  181.          Style           =   1  'Graphical
  182.          TabIndex        =   17
  183.          Top             =   1215
  184.          UseMaskColor    =   -1  'True
  185.          Width           =   1305
  186.       End
  187.       Begin VB.CommandButton cmdRenameTab 
  188.          Caption         =   "Rename Tab"
  189.          Height          =   645
  190.          Left            =   1380
  191.          Picture         =   "frmTest.frx":1AF8
  192.          Style           =   1  'Graphical
  193.          TabIndex        =   16
  194.          Top             =   1215
  195.          UseMaskColor    =   -1  'True
  196.          Width           =   1110
  197.       End
  198.       Begin VB.CommandButton cmdFont 
  199.          Caption         =   "Change Font"
  200.          BeginProperty Font 
  201.             Name            =   "Tahoma"
  202.             Size            =   9.75
  203.             Charset         =   0
  204.             Weight          =   700
  205.             Underline       =   0   'False
  206.             Italic          =   0   'False
  207.             Strikethrough   =   0   'False
  208.          EndProperty
  209.          Height          =   336
  210.          Index           =   0
  211.          Left            =   4050
  212.          TabIndex        =   13
  213.          Top             =   15
  214.          Width           =   1500
  215.       End
  216.       Begin VB.CommandButton cmdFont 
  217.          Caption         =   "Change Font"
  218.          Height          =   336
  219.          Index           =   1
  220.          Left            =   4050
  221.          TabIndex        =   12
  222.          Top             =   360
  223.          Width           =   1500
  224.       End
  225.       Begin VB.CheckBox CheckOptions 
  226.          Caption         =   "Smooth Scrolling"
  227.          Height          =   192
  228.          Index           =   0
  229.          Left            =   1710
  230.          TabIndex        =   11
  231.          Top             =   30
  232.          Value           =   1  'Checked
  233.          Width           =   2295
  234.       End
  235.       Begin VB.CheckBox CheckOptions 
  236.          Caption         =   "Always Show First Tab"
  237.          Height          =   192
  238.          Index           =   4
  239.          Left            =   1710
  240.          TabIndex        =   10
  241.          Top             =   810
  242.          Value           =   1  'Checked
  243.          Width           =   2295
  244.       End
  245.       Begin VB.CheckBox CheckOptions 
  246.          Caption         =   "Items stay down"
  247.          Height          =   192
  248.          Index           =   3
  249.          Left            =   1710
  250.          TabIndex        =   9
  251.          Top             =   615
  252.          Value           =   1  'Checked
  253.          Width           =   2295
  254.       End
  255.       Begin VB.CheckBox CheckOptions 
  256.          Caption         =   "Items move with click"
  257.          Height          =   192
  258.          Index           =   2
  259.          Left            =   1710
  260.          TabIndex        =   8
  261.          Top             =   420
  262.          Value           =   1  'Checked
  263.          Width           =   2295
  264.       End
  265.       Begin VB.CheckBox CheckOptions 
  266.          Caption         =   "Play Sounds"
  267.          Height          =   192
  268.          Index           =   1
  269.          Left            =   1710
  270.          TabIndex        =   7
  271.          Top             =   225
  272.          Value           =   1  'Checked
  273.          Width           =   2295
  274.       End
  275.       Begin VB.OptionButton opView 
  276.          Caption         =   "Small Icons"
  277.          Height          =   210
  278.          Index           =   1
  279.          Left            =   225
  280.          TabIndex        =   6
  281.          Top             =   255
  282.          Width           =   1404
  283.       End
  284.       Begin VB.OptionButton opView 
  285.          Caption         =   "Large Icons"
  286.          Height          =   210
  287.          Index           =   0
  288.          Left            =   225
  289.          TabIndex        =   5
  290.          Top             =   30
  291.          Value           =   -1  'True
  292.          Width           =   1425
  293.       End
  294.       Begin VB.Label lblNavigation 
  295.          Caption         =   "Navigation"
  296.          Height          =   195
  297.          Left            =   15
  298.          TabIndex        =   29
  299.          Top             =   3450
  300.          Width           =   945
  301.       End
  302.       Begin VB.Line lnHoriz 
  303.          BorderColor     =   &H80000014&
  304.          Index           =   7
  305.          X1              =   0
  306.          X2              =   5715
  307.          Y1              =   4425
  308.          Y2              =   4425
  309.       End
  310.       Begin VB.Line lnHoriz 
  311.          BorderColor     =   &H80000010&
  312.          Index           =   6
  313.          X1              =   0
  314.          X2              =   5655
  315.          Y1              =   4410
  316.          Y2              =   4410
  317.       End
  318.       Begin VB.Line lnHoriz 
  319.          BorderColor     =   &H80000010&
  320.          Index           =   5
  321.          X1              =   30
  322.          X2              =   5715
  323.          Y1              =   3405
  324.          Y2              =   3405
  325.       End
  326.       Begin VB.Line lnHoriz 
  327.          BorderColor     =   &H80000014&
  328.          Index           =   4
  329.          X1              =   30
  330.          X2              =   5775
  331.          Y1              =   3420
  332.          Y2              =   3420
  333.       End
  334.       Begin VB.Label Label2 
  335.          Alignment       =   2  'Center
  336.          Caption         =   "I T E M S"
  337.          Height          =   1080
  338.          Left            =   15
  339.          TabIndex        =   19
  340.          Top             =   2130
  341.          Width           =   180
  342.       End
  343.       Begin VB.Line lnHoriz 
  344.          BorderColor     =   &H80000010&
  345.          Index           =   3
  346.          X1              =   -45
  347.          X2              =   5640
  348.          Y1              =   2070
  349.          Y2              =   2070
  350.       End
  351.       Begin VB.Line lnHoriz 
  352.          BorderColor     =   &H80000014&
  353.          Index           =   2
  354.          X1              =   -45
  355.          X2              =   5700
  356.          Y1              =   2085
  357.          Y2              =   2085
  358.       End
  359.       Begin VB.Label Label1 
  360.          Alignment       =   2  'Center
  361.          Caption         =   "V I E W"
  362.          Height          =   825
  363.          Left            =   15
  364.          TabIndex        =   15
  365.          Top             =   30
  366.          Width           =   180
  367.       End
  368.       Begin VB.Label lblTabs 
  369.          Alignment       =   2  'Center
  370.          Caption         =   "T A B S"
  371.          Height          =   825
  372.          Left            =   15
  373.          TabIndex        =   14
  374.          Top             =   1185
  375.          Width           =   180
  376.       End
  377.       Begin VB.Line lnHoriz 
  378.          BorderColor     =   &H80000014&
  379.          Index           =   1
  380.          X1              =   0
  381.          X2              =   5745
  382.          Y1              =   1125
  383.          Y2              =   1125
  384.       End
  385.       Begin VB.Line lnHoriz 
  386.          BorderColor     =   &H80000010&
  387.          Index           =   0
  388.          X1              =   0
  389.          X2              =   5685
  390.          Y1              =   1110
  391.          Y2              =   1110
  392.       End
  393.       Begin VB.Label lblMessages 
  394.          Caption         =   "Events"
  395.          Height          =   945
  396.          Left            =   15
  397.          TabIndex        =   2
  398.          Top             =   4545
  399.          Width           =   3270
  400.          WordWrap        =   -1  'True
  401.       End
  402.    End
  403.    Begin DevPowerButtnBar.ButtnBar ButtonBar 
  404.       Align           =   3  'Align Left
  405.       Height          =   7530
  406.       Left            =   0
  407.       TabIndex        =   0
  408.       TabStop         =   0   'False
  409.       Top             =   0
  410.       Width           =   1680
  411.       _ExtentX        =   2963
  412.       _ExtentY        =   13282
  413.       _Type           =   "00007615303F262704031E0E3E646373757B617673137F700067606F706160723E676B7B7B66637376"
  414.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  415.          Name            =   "MS Sans Serif"
  416.          Size            =   8.25
  417.          Charset         =   0
  418.          Weight          =   400
  419.          Underline       =   0   'False
  420.          Italic          =   0   'False
  421.          Strikethrough   =   0   'False
  422.       EndProperty
  423.       ScrollDelay     =   200
  424.       SoundItemURL    =   "C:\WINDOWS\MEDIA\CHORD.WAV"
  425.       SoundTabUpURL   =   "C:\WINDOWS\MEDIA\Jungle Error.wav"
  426.       SoundTabDownURL =   "C:\WINDOWS\MEDIA\Jungle Exclamation.wav"
  427.       TrackNavigation =   -1  'True
  428.       NumTabs         =   2
  429.       Caption1        =   "Outlook Items"
  430.       Enabled1        =   -1  'True
  431.       View1           =   0
  432.       Tab1Items       =   6
  433.       Tab1Item1Caption=   "Button Bar Today"
  434.       Tab1Item1MaskColor=   16711935
  435.       Tab1Item1Picture=   "frmTest.frx":1BF2
  436.       Tab1Item1SmallPicture=   "frmTest.frx":1F0C
  437.       Tab1Item2Caption=   "Inbox"
  438.       Tab1Item2MaskColor=   16711935
  439.       Tab1Item2Picture=   "frmTest.frx":245E
  440.       Tab1Item2SmallPicture=   "frmTest.frx":2778
  441.       Tab1Item3Caption=   "Calendar"
  442.       Tab1Item3MaskColor=   16711935
  443.       Tab1Item3Picture=   "frmTest.frx":2CCA
  444.       Tab1Item3SmallPicture=   "frmTest.frx":2FE4
  445.       Tab1Item4Caption=   "Contacts"
  446.       Tab1Item4MaskColor=   16711935
  447.       Tab1Item4Picture=   "frmTest.frx":3536
  448.       Tab1Item5Caption=   "Search"
  449.       Tab1Item5MaskColor=   16711935
  450.       Tab1Item5Picture=   "frmTest.frx":3850
  451.       Tab1Item5SmallPicture=   "frmTest.frx":40A2
  452.       Tab1Item6Caption=   "Disabled Item"
  453.       Tab1Item6ToolTip=   "This item is disabled..."
  454.       Tab1Item6Enabled=   0   'False
  455.       Tab1Item6MaskColor=   16711935
  456.       Tab1Item6Picture=   "frmTest.frx":45F4
  457.       Caption2        =   "Empty Tab"
  458.       Enabled2        =   -1  'True
  459.       ToolTip2        =   "Version 1.0.4 allows independant tool tips!"
  460.       View2           =   0
  461.    End
  462.    Begin VB.Label lblHeader 
  463.       BackColor       =   &H80000010&
  464.       Caption         =   " Header"
  465.       BeginProperty Font 
  466.          Name            =   "Arial"
  467.          Size            =   14.25
  468.          Charset         =   0
  469.          Weight          =   700
  470.          Underline       =   0   'False
  471.          Italic          =   0   'False
  472.          Strikethrough   =   0   'False
  473.       EndProperty
  474.       ForeColor       =   &H80000005&
  475.       Height          =   435
  476.       Left            =   1920
  477.       TabIndex        =   4
  478.       Top             =   15
  479.       Width           =   5475
  480.    End
  481.    Begin VB.Image imgNew 
  482.       Appearance      =   0  'Flat
  483.       Height          =   480
  484.       Index           =   0
  485.       Left            =   1800
  486.       Picture         =   "frmTest.frx":4E46
  487.       Top             =   7005
  488.       Visible         =   0   'False
  489.       Width           =   480
  490.    End
  491.    Begin VB.Image imgNew 
  492.       Appearance      =   0  'Flat
  493.       Height          =   195
  494.       Index           =   1
  495.       Left            =   2295
  496.       Picture         =   "frmTest.frx":5150
  497.       Stretch         =   -1  'True
  498.       Top             =   7140
  499.       Visible         =   0   'False
  500.       Width           =   195
  501.    End
  502.    Begin VB.Menu m_bb 
  503.       Caption         =   "&Button Bar Items"
  504.       Visible         =   0   'False
  505.       Begin VB.Menu m_bbitems 
  506.          Caption         =   "Button Bar Popup Menu"
  507.          Begin VB.Menu m_itemopen 
  508.             Caption         =   "&Open Folder"
  509.             Visible         =   0   'False
  510.          End
  511.          Begin VB.Menu m_itemremove 
  512.             Caption         =   "R&emove from Button Bar"
  513.             Visible         =   0   'False
  514.          End
  515.          Begin VB.Menu m_itemrename 
  516.             Caption         =   "&Rename Shortcut"
  517.             Visible         =   0   'False
  518.          End
  519.          Begin VB.Menu m_sep1 
  520.             Caption         =   "-"
  521.          End
  522.          Begin VB.Menu m_icons 
  523.             Caption         =   "&Large Icons"
  524.             Checked         =   -1  'True
  525.             Index           =   0
  526.          End
  527.          Begin VB.Menu m_icons 
  528.             Caption         =   "&Small Icons"
  529.             Index           =   1
  530.          End
  531.          Begin VB.Menu m_sep2 
  532.             Caption         =   "-"
  533.          End
  534.          Begin VB.Menu m_tabadd 
  535.             Caption         =   "&Add New Group"
  536.          End
  537.          Begin VB.Menu m_tabremove 
  538.             Caption         =   "R&emove Group"
  539.          End
  540.          Begin VB.Menu m_tabrename 
  541.             Caption         =   "&Rename Group"
  542.          End
  543.          Begin VB.Menu m_itemproperties 
  544.             Caption         =   "&Properties"
  545.          End
  546.       End
  547.    End
  548. Attribute VB_Name = "frmTest"
  549. Attribute VB_GlobalNameSpace = False
  550. Attribute VB_Creatable = False
  551. Attribute VB_PredeclaredId = True
  552. Attribute VB_Exposed = False
  553. Option Base 1
  554. Private iTabClicked As Integer
  555. Private iItemClicked As Integer
  556. Private Sub ButtonBar_Click(ByVal iTab As Integer, ByVal iItem As Integer)
  557. Dim sMessage As String
  558.     iTabClicked = iTab
  559.     iItemClicked = iItem
  560.     If iTab = 0 Then
  561.         sMessage = "General Click"
  562.     Else
  563.         opView(0).Value = (ButtonBar.CurrentView = LargeIcons)
  564.         opView(1).Value = (ButtonBar.CurrentView = SmallIcons)
  565.         If iItem = 0 Then
  566.             sMessage = "Tab '" + ButtonBar.CurrentCaption + "' Clicked - " + CStr(iTab)
  567.         Else
  568.             ButtonBar.CurrentItem = iItem
  569.             chkEnabled.Caption = "Current Item (" + CStr(iItem) + ") Enabled"
  570.             chkEnabled.Value = ButtonBar.CurrentItemEnabled And vbChecked
  571.             sMessage = "Item Clicked - Tab " + CStr(iTab) + ", Item " + CStr(iItem) + " '" + ButtonBar.CurrentItemCaption + "'"
  572.         End If
  573.     End If
  574.     If iItem <> 0 Then lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
  575.     lblMessages.Caption = sMessage
  576.     cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
  577.     cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
  578.     cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
  579. End Sub
  580. Private Sub ButtonBar_ItemRenamed(ByVal iTab As Integer, ByVal iItem As Integer)
  581.     lblMessages.Caption = "Item Renamed - Tab " + CStr(iTab) + " Item " + CStr(iItem)
  582.     lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
  583. End Sub
  584. Private Sub ButtonBar_RightClick(ByVal iTab As Integer, ByVal iItem As Integer)
  585. Dim sMessage As String
  586.     iTabClicked = iTab
  587.     iItemClicked = iItem
  588.     If iItem = 0 Then
  589.         sMessage = "Tab Right Clicked - " + CStr(iTab)
  590.         m_tabadd.Visible = True
  591.         m_tabremove.Visible = True
  592.         m_tabrename.Visible = True
  593.         m_itemopen.Visible = False
  594.         m_itemremove.Visible = False
  595.         m_itemrename.Visible = False
  596.         m_itemproperties.Visible = False
  597.         m_sep1.Visible = False
  598.         If ButtonBar.Tabs(iTabClicked).View = LargeIcons Then
  599.             m_icons(0).Checked = True
  600.             m_icons(1).Checked = False
  601.         Else
  602.             m_icons(0).Checked = False
  603.             m_icons(1).Checked = True
  604.         End If
  605.         PopupMenu m_bbitems
  606.     Else
  607.         m_tabadd.Visible = False
  608.         m_tabremove.Visible = False
  609.         m_tabrename.Visible = False
  610.         m_itemopen.Visible = True
  611.         m_itemopen.Enabled = ButtonBar.Tabs(iTab).Items(iItem).Enabled
  612.         m_itemremove.Visible = True
  613.         m_itemrename.Visible = True
  614.         m_itemproperties.Visible = True
  615.         m_sep1.Visible = True
  616.         If ButtonBar.Tabs(iTabClicked).View = LargeIcons Then
  617.             m_icons(0).Checked = True
  618.             m_icons(1).Checked = False
  619.         Else
  620.             m_icons(0).Checked = False
  621.             m_icons(1).Checked = True
  622.         End If
  623.         chkEnabled.Caption = "Current Item (" + CStr(iItem) + ") Enabled"
  624.         chkEnabled.Value = ButtonBar.Tabs(iTab).Items(iItem).Enabled And vbChecked
  625.         sMessage = "Item Right Clicked - Tab " + CStr(iTab) + ", Item " + CStr(iItem) + " '" + ButtonBar.Tabs(iTab).Items(iItem).Caption + "'"
  626.         PopupMenu m_bbitems
  627.     End If
  628.     lblMessages.Caption = sMessage
  629. End Sub
  630. Private Sub ButtonBar_ScrollDown(ByVal iTab As Integer)
  631.     lblMessages.Caption = "Scroll Down - " + CStr(iTab)
  632. End Sub
  633. Private Sub ButtonBar_ScrollUp(ByVal iTab As Integer)
  634.     lblMessages.Caption = "Scroll Up - " + CStr(iTab)
  635. End Sub
  636. Private Sub ButtonBar_TabRenamed(ByVal iTab As Integer)
  637.     lblMessages.Caption = "Tab Renamed - " + CStr(iTab)
  638. End Sub
  639. Private Sub CheckOptions_Click(Index As Integer)
  640.     Select Case Index
  641.         Case 0
  642.             ButtonBar.SmoothScroll = (CheckOptions(Index).Value = vbChecked)
  643.         Case 1
  644.             ButtonBar.PlaySounds = (CheckOptions(Index).Value = vbChecked)
  645.         Case 2
  646.             ButtonBar.ItemsMoveWithClick = (CheckOptions(Index).Value = vbChecked)
  647.         Case 3
  648.             ButtonBar.ItemsStayDownWithClick = (CheckOptions(Index).Value = vbChecked)
  649.         Case 4
  650.             ButtonBar.AlwaysShowFirstTab = (CheckOptions(Index).Value = vbChecked)
  651.     End Select
  652. End Sub
  653. Private Sub chkEnabled_Click()
  654.     On Error Resume Next
  655.     ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Enabled = chkEnabled.Value And vbChecked
  656. End Sub
  657. Private Sub cmdAddTab_Click()
  658.     ButtonBar.AddTab ("Tab " + CStr(ButtonBar.NumTabs + 1))
  659. End Sub
  660. Private Sub cmdFont_Click(Index As Integer)
  661.     ButtonBar.Font = cmdFont(Index).Font
  662.     lblHeader.Height = ButtonBar.TabHeight
  663.     SizeBits
  664. End Sub
  665. Private Sub cmdNavBack_Click()
  666.     ButtonBar.Navigation.GoBack
  667.     cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
  668.     cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
  669.     cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
  670. End Sub
  671. Private Sub cmdNavForward_Click()
  672.     ButtonBar.Navigation.GoForward
  673.     cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
  674.     cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
  675.     cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
  676. End Sub
  677. Private Sub cmdNavHistory_Click()
  678.     Dim sHistory As String, sSubStr As String
  679.     Dim lPos As Long, lLastPos As Long
  680.     If ButtonBar.Navigation.Enabled Then
  681.         Load frmHistory
  682.         Set frmHistory.ParentWindow = Me
  683.         sHistory = ButtonBar.Navigation.GetHistoryList
  684.         lLastPos = 1
  685.         Do While lLastPos > 0
  686.             lPos = InStr(lLastPos + 1, sHistory, ",")
  687.             If lPos > 0 Then
  688.                 sSubStr = Mid(sHistory, lLastPos, lPos - lLastPos)
  689.             Else
  690.                 sSubStr = Mid(sHistory, lLastPos)
  691.             End If
  692.             frmHistory.HistoryList.AddItem Left(sSubStr, InStr(1, sSubStr, ";") - 1)
  693.             If lPos > 0 Then
  694.                 lLastPos = lPos + 1
  695.             Else
  696.                 lLastPos = 0
  697.             End If
  698.         Loop
  699.         frmHistory.iCurrentPosition = ButtonBar.Navigation.CurrentPosition
  700.         frmHistory.HistoryList.ListIndex = ButtonBar.Navigation.CurrentPosition - 1
  701.         frmHistory.Show vbModal
  702.         cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
  703.         cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
  704.         cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
  705.     End If
  706. End Sub
  707. Private Sub cmdRemoveCurrItem_Click()
  708.     lblMessages.Caption = "Item Removed - " + CStr(ButtonBar.RemoveItem(ButtonBar.CurrentTab, ButtonBar.CurrentItem)) + " Items Remaining"
  709. End Sub
  710. Private Sub cmdRemoveCurrTab_Click()
  711.     ButtonBar.RemoveTab ButtonBar.CurrentTab
  712. End Sub
  713. Private Sub cmdRemoveTab_Click()
  714.     ButtonBar.RemoveLastTab
  715. End Sub
  716. Private Sub cmdAddItem_Click()
  717.     lblMessages.Caption = "Item Added - " + CStr(ButtonBar.AddItem(ButtonBar.CurrentTab, "Item " + CStr(ButtonBar.NumItems + 1))) + " in total"
  718.     With ButtonBar.Tabs(ButtonBar.CurrentTab).Items(ButtonBar.NumItems)
  719.         .MaskColor = RGB(192, 192, 192)
  720.         .Picture = imgNew(0).Picture
  721.         .SmallPicture = imgNew(1).Picture
  722.     End With
  723. End Sub
  724. Private Sub cmdInsertItem_Click()
  725.     Dim iTab As Integer, iItem As Integer
  726.     iTab = ButtonBar.CurrentTab
  727.     iItem = ButtonBar.CurrentItem
  728.     ButtonBar.Tabs(iTab).Items.Insert iItem, "Item " + CStr(ButtonBar.NumItems + 1)
  729.     lblMessages.Caption = "Item Added - " + CStr(ButtonBar.NumItems) + " in total"
  730.     With ButtonBar.Tabs(iTab).Items(iItem + 1)
  731.         .MaskColor = RGB(192, 192, 192)
  732.         .Picture = imgNew(0).Picture
  733.         .SmallPicture = imgNew(1).Picture
  734.     End With
  735. End Sub
  736. Private Sub cmdRemoveLastItem_Click()
  737.     lblMessages.Caption = "Item Removed - " + CStr(ButtonBar.RemoveLastItem(ButtonBar.CurrentTab)) + " Items Remaining"
  738. End Sub
  739. Private Sub cmdRelabelItem_Click()
  740.     ButtonBar.RelabelItem ButtonBar.CurrentItem
  741. End Sub
  742. Private Sub cmdRenameTab_Click()
  743.     ButtonBar.RelabelTab (ButtonBar.CurrentTab)
  744. End Sub
  745. Private Sub Command1_Click()
  746.     MsgBox ButtonBar.Navigation.GetHistoryList
  747. End Sub
  748. Private Sub opView_Click(Index As Integer)
  749.     ButtonBar.CurrentView = Index
  750. End Sub
  751. Private Sub Form_Load()
  752.     opView(0).Value = (ButtonBar.CurrentView = LargeIcons)
  753.     opView(1).Value = (ButtonBar.CurrentView = SmallIcons)
  754.     CheckOptions(0).Value = ButtonBar.SmoothScroll And vbChecked
  755.     CheckOptions(1).Value = ButtonBar.PlaySounds And vbChecked
  756.     CheckOptions(2).Value = ButtonBar.ItemsMoveWithClick And vbChecked
  757.     CheckOptions(3).Value = ButtonBar.ItemsStayDownWithClick And vbChecked
  758.     CheckOptions(4).Value = ButtonBar.AlwaysShowFirstTab And vbChecked
  759.     chkEnabled.Value = ButtonBar.CurrentItemEnabled And vbChecked
  760. '    frTab.Caption = "Current Tab (" + CStr(ButtonBar.CurrentTab) + "):"
  761.     lblMessages.Caption = "DevPower ButtnBar Version " + ButtonBar.Version + " (" + ButtonBar.VBVersion + ")"
  762.     ButtonBar.CurrentItem = 1
  763.     iTabClicked = 1
  764.     iItemClicked = 1
  765.     lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
  766.     lnShadow.Y1 = 0
  767.     lnLightShadow.Y1 = 0
  768.     SizeBar.BackColor = vbButtonFace
  769.     SizeBar.Left = ButtonBar.Left + ButtonBar.Width
  770.     SizeBar.ZOrder
  771.     SizeBits
  772. End Sub
  773. Private Sub Form_Resize()
  774.     SizeBits
  775. End Sub
  776. Private Sub SizeBits()
  777.     SizeBar.Top = 0
  778.     SizeBar.Height = Me.ScaleHeight
  779.     lnShadow.Y2 = SizeBar.Height
  780.     lnLightShadow.Y2 = lnShadow.Y2
  781.     ' Size Header
  782.     lblHeader.Height = ButtonBar.TabHeight
  783.     lblHeader.Top = ButtonBar.Top + 1
  784.     lblHeader.Left = SizeBar.Left + SizeBar.Width
  785.     lblHeader.Width = Me.ScaleWidth - lblHeader.Left
  786.     ' Size Main panel
  787.     picMain.Top = lblHeader.Top + lblHeader.Height
  788.     picMain.Left = SizeBar.Left + SizeBar.Width + 3
  789.     picMain.Width = Me.ScaleWidth - picMain.Left
  790.     picMain.Height = Me.ScaleHeight - picMain.Top
  791.     lnHoriz(0).X2 = picMain.ScaleWidth
  792.     lnHoriz(1).X2 = picMain.ScaleWidth
  793.     lnHoriz(2).X2 = picMain.ScaleWidth
  794.     lnHoriz(3).X2 = picMain.ScaleWidth
  795.     lnHoriz(4).X2 = picMain.ScaleWidth
  796.     lnHoriz(5).X2 = picMain.ScaleWidth
  797. End Sub
  798. Private Sub SizeBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  799.     If Button = vbLeftButton Then SizeBar.BackColor = vb3DDKShadow
  800. End Sub
  801. Private Sub SizeBar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  802.     Dim L As Long, SW As Long
  803.     If Button = vbLeftButton Then
  804.         L = SizeBar.Left + X
  805.         SW = Me.ScaleWidth
  806.         If (L < 55) Then                            ' Minimum Size
  807.             L = 55                                  ' Fix Position
  808.         ElseIf L > (SW - 100 - SizeBar.Width) Then  ' Outside Right Of Window
  809.             L = SW - 100 - SizeBar.Width            ' Fix Position
  810.         End If
  811.         SizeBar.Left = L
  812.     End If
  813. End Sub
  814. Private Sub SizeBar_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  815.     Dim L As Long, w As Long, SW As Long
  816.     Dim L2 As Long, W2 As Long
  817.     With SizeBar
  818.         .BackColor = vbButtonFace
  819.         L = .Left
  820.         w = .Width
  821.         SW = Me.ScaleWidth
  822.         
  823.         If (L < 55) Then                            ' Minimum Size
  824.             L = 55                                  ' Fix Position
  825.             .Left = L                               ' Adjust sizebar position
  826.         ElseIf L > (SW - 100 - w) Then              ' Outside Right Of Window
  827.             L = SW - 100 - w                        ' Fix Position
  828.             .Left = L                               ' Adjust sizebar position
  829.         End If
  830.         
  831.         ButtonBar.Width = Abs(L - ButtonBar.Left)   ' Resize Button Bar Width
  832.         L2 = L + w
  833.         W2 = Abs(SW - L - w)
  834.     End With
  835.     SizeBits
  836. End Sub
  837. ' =====================================================
  838. ' Pop Up  Menu Items:
  839. ' =====================================================
  840. Private Sub m_icons_Click(Index As Integer)
  841.     ButtonBar.Tabs(iTabClicked).View = Index
  842.     If ButtonBar.CurrentTab = iTabClicked Then opView(Index).Value = True
  843. End Sub
  844. Private Sub m_tabadd_Click()
  845.     ButtonBar.RelabelTab ButtonBar.AddTab("New Tab")
  846. End Sub
  847. Private Sub m_tabremove_Click()
  848.     If MsgBox("Are you sure you want to remove the specified Tab?", vbExclamation + vbYesNo, "DevPower Button Bar Test Application") = vbYes Then
  849.         ButtonBar.RemoveTab iTabClicked
  850.     End If
  851. End Sub
  852. Private Sub m_tabrename_Click()
  853.     ButtonBar.RelabelTab iTabClicked
  854. End Sub
  855. Private Sub m_itemopen_Click()
  856.     ButtonBar.CurrentItem = iItemClicked
  857.     lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
  858. End Sub
  859. Private Sub m_itemproperties_Click()
  860.     Load frmProperties
  861.     frmProperties.picImage = ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Picture
  862.     frmProperties.lblCaption.Caption = ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Caption
  863.     If ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Enabled Then
  864.         frmProperties.lblEnabled.Caption = "Enabled"
  865.     Else
  866.         frmProperties.lblEnabled.Caption = "Disabled"
  867.     End If
  868.     frmProperties.Show vbModal
  869. End Sub
  870. Private Sub m_itemremove_Click()
  871.     If MsgBox("Are you sure you want to remove this shortcut?", vbExclamation + vbYesNo, "DevPower Button Bar Test Application") = vbYes Then
  872.         ButtonBar.RemoveItem ButtonBar.CurrentTab, iItemClicked
  873.     End If
  874. End Sub
  875. Private Sub m_itemrename_Click()
  876.     ButtonBar.RelabelItem iItemClicked
  877. End Sub
  878.